<form action="<?php echo BASE_URL; ?>/<?php echo $this->controller;?>/<?php echo $this->actionName;?>"	method="POST" name="quiz-form" id="">
	<input type="hidden" name="id" value="<?php echo $this->Obj['id'] ;?>">		
	<input type="hidden" name="isupdate" value="<?php echo $this->Obj['isupdate'];?>"/>			
	<table cellpadding="0" cellspacing="0">
		<tr><td class="label">
				Chuyên mục: 
				</td><td class="field_container"> 
				<?php  echo $this->sltCategory("category_id",$this->Obj['category_id'],2);?>
		</td></tr>
		<tr style="display: none;">
			<td colspan="5">
				<p style="float: right; font-weight: 600;vertical-align: top; ">
					Nhập đường dẫn hình &nbsp;&nbsp;<input type="checkbox" id="chkChangeTypeUploadImage" onchange="fnChangeTypeUploadImage(this); return false; " value="">
				</p>
			</td>
		</tr>
		<tr style="display: none;"><td class="label">
				Hình mô tả :
				</td><td class="field_container"> 
			    <table>
			    	<tr>
			    		<td>
			    			<div id="imageShow"><img src="<?php echo BASE_URL; ?>/media/upload/news/<?php echo $this->escape($this->Obj['path_image']); ?>" width="150" height="90" > </div>
			    		</td>
			    		<td align="right" width="400">
			    		<span class="input-path-image-text" style="display: none;">				    					    		
			    			<input type="text" id="path_image_hide" name="path_image_hide" value="" style="width: 350px">
			    		</span>
			    		<span class="input-path-image-jquery">
			    			<input id="uploadImage" name="path_image1" type="file" >
			    			<a href="javascript:$('#uploadImage').uploadifyUpload();">Tải hình ảnh</a>
			    			<span class="input-path-image-jquery-temp">
			    				<input name="path_image" type="hidden" id="path_image" value="<?php echo$this->escape($this->Obj['path_image']); ?>" size="60" maxlength="64"/>
			    			</span>
			    		</span>

			    		</td>
			    	</tr>
			     </table>
				
		</td></tr>
		<tr><td class="label">
				Tiêu đề tin :
				</td><td class="field_container"> 
				<textarea style="font-size: 16px;font-weight: 600;" name="title" rows="3" cols="20"><?php echo $this->Obj['title'];?></textarea>
		</td></tr>
		<tr><td class="label">
				Mô tả chung :
				</td><td class="field_container"> 
				<textarea class="short-editor-description-news" name="description" rows="5" cols="10"><?php  echo $this->Obj['description']; ?></textarea>
		</td></tr>
		<tr><td class="label">
				Nội dung:
				</td><td class="field_container"> 
				<textarea class="editor" id="content-news" name="content" rows="3" cols="20"><?php echo $this->Obj['content'];?></textarea>
		</td></tr>
		<tr><td class="label">
				Hiển thị tin tức:
				</td><td class="field_container">  
		    	<select name="publish">
		    		<option value="0" <?php if($this->Obj['publish']==0) echo "selected selected";?>>Không hiển thị</option>
		    		<option value="1" <?php if($this->Obj['publish']==1) echo "selected selected";?>>Hiển thị</option>
		    	</select>
		</td></tr>
		<tr><td colspan="5"  style="font-size: 12px; color: white; font-family: tahoma;"  >
				<p align="center">
					<input  type="submit" value="Đồng ý" style="font-size: 15px;" class="add-answer-icon ui-state-default ui-corner-all">&nbsp;&nbsp;&nbsp;&nbsp;
					<input  type="button" value="Hủy bỏ" onclick="window.location='<?php echo  BASE_URL.'/news';  ?>'" style="font-size: 15px;" class="add-answer-icon ui-state-default ui-corner-all">
				</p>
		</td></tr>
		
	</table>		
</form>
<script type="text/javascript">
<!--
//-->

$(document).ready(function(){	
	initShortEditorByClass("short-editor-description-news",600,false,true);
	initEditorById("content-news",600,false,true);
		$('#uploadImage').uploadify({
					'uploader'  : '<?php echo BASE_URL;?>/js/jquery.uploadify-v2.1.0/uploadify.swf',
					'script'    : '<?php echo BASE_URL;?>/js/jquery.uploadify-v2.1.0/uploadify.php',
					'cancelImg' : '<?php echo BASE_URL;?>/js/jquery.uploadify-v2.1.0/cancel.png',
					'auto'      : false,
					'sizeLimit'   : 1024000,
					'fileExt'     : '*.jpg;*.gif;*.png',
					'fileDesc'    : 'Web Image Files (.JPG, .GIF, .PNG)',
					'folder'    : '<?php echo BASE_URL;?>/media/upload/news',
					onComplete: function(event, queueID, fileObj, reposnse, data) {
						$("#path_image").val(reposnse);
						$("#imageShow").html("<img src='<?php echo BASE_URL;?>/media/upload/news/"+reposnse+"' width='150' height='90'>");
						//$('#filesUploaded').append('<a href='+fileObj.filePath+'>'+fileObj.name+'</a><br>');
					}
			});	

});

function fnChangeTypeUploadImage(_this){
	is_check = $(_this).attr("checked");
	if(is_check==true){
		htmlInputShow='<input type="text" id="path_image" name="path_image" value="" style="width: 350px">';
		htmlInputHide='<input name="path_image_hide" type="hidden" id="path_image_hide" value="<?php echo $this->escape($this->Obj["path_image"]); ?>" size="60" maxlength="64"/>';
		$(".input-path-image-jquery").hide();
		$(".input-path-image-text").html(htmlInputShow);
		$(".input-path-image-text").show();
		$(".input-path-image-jquery-temp").html(htmlInputHide);
		
	}else{
		htmlInputHide='<input type="text" id="path_image_hide" name="path_image_hide" value="" style="width: 350px">';
		htmlInputShow='<input name="path_image" type="hidden" id="path_image" value="<?php echo $this->escape($this->Obj["path_image"]); ?>" size="60" maxlength="64"/>';
		$(".input-path-image-text").html(htmlInputHide);
		$(".input-path-image-text").hide();
		$(".input-path-image-jquery-temp").html(htmlInputShow);
		$(".input-path-image-jquery").show();
		
	}
}

</script>
